package com.yugao.fintech.draper.admin.configure;

import com.yugao.fintech.draper.admin.entity.SysDept;
import com.yugao.fintech.draper.admin.entity.SysLoginLog;
import com.yugao.fintech.draper.admin.entity.SysUser;
import com.yugao.fintech.draper.datascope.strategy.DataScopeStrategyConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration(proxyBeanMethods = false)
public class DataScopeConfiguration {
	@Bean
	public DataScopeStrategyConfiguration deptDataPermissionRuleCustomizer() {
		return rule -> {
			// 部门
			rule.addDeptColumn(SysDept.class);
			rule.addDeptColumn(SysLoginLog.class);
			// 用户
			rule.addUserColumn(SysUser.class, "user_id");
		};
	}
}
